package com.qf.boot1.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author 刘欣
 * @createTime 2023/2/2 14:57
 * @description
 */
//@Aspect
//@Component
@Slf4j
public class MyAspect {

    @Pointcut("execution(* com.qf.boot1.controller..*.*(..))")
    public void MyPointCut() {

    }

    @Before("MyPointCut()")
    public void before() {
        log.debug("MyBefore");
    }

    @Around("MyPointCut()")
    public Object around(ProceedingJoinPoint pjt) throws Throwable {
        log.debug("MyAround=========>");

        Object proceed = pjt.proceed();

        log.debug("MyAround<=========");

        return proceed;
    }

    @After("MyPointCut()")
    public void after() {
        log.debug("myAfter");
    }
}
